package builder.again;

public class Worker extends IBuild {

    private Product product;
    
    public Worker(){
        product = new Product();
    }

    @Override
    IBuild buildA(String msg) {
        product.setBuildA(msg);
        System.out.println("工人建造了buildA");
        return this;
    }

    @Override
    IBuild buildB(String msg) {
        product.setBuildB(msg);
        System.out.println("工人建造了buildB");
        return this;
    }

    @Override
    IBuild buildC(String msg) {
        product.setBuildC(msg);
        System.out.println("工人建造了buildC");
        return this;
    }

    @Override
    Product getProdut() {
        return product;
    }
    
}
